{% extends "base.html" %}
{% block base.html %}
    <style type="text/css">
        #archive {
            margin: 0 auto;
        }
        @media screen and (min-width: 1200px) {
            #archive {
                width: 60%;
            }
        }
        @media screen and (max-width: 1100px) {
            #archive {
                width: 92%;
            }
        }
        @media screen and (max-width: 800px) {
            #archive {
                width: 96%;
            }
        }
        @media screen and (max-width: 600px) {
            #archive {
                width: 100%;
            }
        }
    </style>
    <div class="card hoverable" id="archive">
        <div class="card-content">
            <div class="card-title"><h4>本周总览</h4></div>
            {% for group in groups %}
                <h5>{{ group.group }}</h5>
                {% for member in group.member_set.all %}
                <ul class="collection with-header" style="list-style-type: none;border-color: transparent">
                    <li class="collection-header">
                        <span>{{ member.member }}&nbsp;&nbsp;</span>
                    {% for article in member.article_set.all %}
                        {% if article in articles %}
                            <a class="waves-effect waves-light light-blue-text" href={% url "article_detail_page" article.member.number article.year.year article.year.first_half article.week.week %}>
                                <span>{{ article.upload_time|date:"Y-m-d" }}&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                <span>{{ article.member }}{{ article.year }}第{{ article.week }}周周总结</span>
                            </a>
                        {% endif %}
                    {% endfor %}
                    </li>
                </ul>
                {% endfor %}
            {% empty %}
                <h2>No Data</h2>
            {% endfor %}
        </div>
    </div>
{% endblock %}